use crate::handler::MsgInfo;
use windows_sys::{
    Win32::Foundation::*, Win32::Graphics::Gdi::*, Win32::System::LibraryLoader::GetModuleHandleW,
    Win32::UI::Controls::*, Win32::UI::WindowsAndMessaging::*, core::*,
};

pub const IDC_BTN1: u32 = 1001;
pub const IDC_BTN2: u32 = 1002;
pub const IDC_BTN3: u32 = 1003;
pub const IDC_BTN4: u32 = 1004;
pub const IDC_BTN5: u32 = 1005;

pub fn handle_command(info: MsgInfo) {
    unsafe {
        if info.id == IDC_BTN1 {
            if info.event == BN_CLICKED {
                println!("Button 1 clicked");
                SendMessageW(
                    info.lparam as HWND,
                    WM_SETTEXT,
                    0,
                    w!("按钮1被点击!") as LPARAM,
                );
                MessageBoxW(
                    info.window,
                    w!("按钮 1 被点击!"),
                    w!("提示"),
                    MB_OK | MB_ICONINFORMATION,
                );
            }
        }
    }
}
